﻿using System;
class CompareCharArrays
{
    static void Main()
    {
        int lenght;
        Console.Write("please enter the lenght of arrays: ");
        while (true)
        {
            try
            {
                lenght = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter lenght:");
            }
        }
        char[] arrayOne;
        arrayOne = new char[lenght];
        char[] arrayTwo;
        arrayTwo = new char[lenght];
        for (int i = 0; i < lenght; i++)
        {
            Console.Write("Please enter the {0} element of array one: ", i);

            arrayOne[i] = (char)Console.Read();

                

            
        }
        Console.WriteLine();
        for (int i = 0; i < lenght; i++)
        {
            Console.Write("Please enter the {0} element of array two: ", i);

                    arrayTwo[i] = (char)Console.Read();

        }
        Console.WriteLine();
        for (int i = 0; i < lenght; i++)
        {
            if (arrayOne[i] == arrayTwo[i])
            {
                Console.WriteLine("the elemnts {0} of arrays \"one\" and \"two\" are {1} and {2}. {1} = {2}", i, arrayOne[i], arrayTwo[i]);
            }
            else
            {
                if (arrayOne[i] > arrayTwo[i])
                {
                    Console.WriteLine("the elemnts {0} of arrays \"one\" and \"two\" are {1} and {2}. {1} > {2}", i, arrayOne[i], arrayTwo[i]);
                }
                else
                {
                    Console.WriteLine("the elemnts {0} of arrays \"one\" and \"two\" are {1} and {2}. {1} < {2}", i, arrayOne[i], arrayTwo[i]);
                }
            }
        }
        Console.ReadLine();
    }
}

